<!--
 * @Author: linZeJian
 * @Date: 2022-05-20 15:40:51
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-05-20 15:43:16
 * @Description: 
-->
<template>
  <div class="w100 h100">
    <el-button size="mini" type="info" plain id="copyUrl">复制</el-button>
  </div>
</template>
<script>
import ClipboardJS from "clipboard";
  export default {
    name :'',
    components: {
    },
    props: {},
    data () {
      return {
        appletsPreviewUrl: "1111"
      };
    },
    computed: {},
    created() {},
    mounted() {
      const clipboard = new ClipboardJS("#copyUrl", {
      text: trigger => {
        const codeStr = this.appletsPreviewUrl;
        this.$message.success("代码已复制到剪切板");
        this.dialogVisible = false;
        return codeStr;
      }
    });
    clipboard.on("error", e => {
      this.$message.error("代码复制失败");
    });
  },
    },
    methods: {},
    watch: {},
  }
</script>
<style lang="scss" scoped></style>
